package com.mayikt.consumer;//package com.mayikt.consumer;
//
//import com.alibaba.fastjson.JSONObject;
//import com.mayikt.entity.OrderEntity;
//import com.mayikt.mapper.OrderMapper;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * @author 蚂蚁课堂创始人-余胜军QQ644064779
// * @title: OrderDlxConsumer
// * @description: 每特教育独创第五期互联网架构课程
// * @date 2019/12/1221:35
// */
//@Component
//public class OrderConsumer {
//
//    @Autowired
//    private OrderMapper orderMapper;
//
//    /**
//     * 监听我们的订单队列
//     *
//     * @return
//     */
//    @RabbitListener(queues = "my_queue")
//    public void orderConsumer(String msg) {
//        System.out.println("订单队列获取消息:" + msg);
//        OrderEntity orderEntity = JSONObject.parseObject(msg, OrderEntity.class);
//        if (orderEntity == null) {
//            return;
//        }
//        orderMapper.addOrder(orderEntity);
//
//    }
//}
